package chapter01

import sun.plugin2.jvm.CircularByteBuffer
import java.util.*
import kotlin.collections.HashMap
import kotlin.collections.HashSet

fun main() {

    val a = LinkedList<String>()
    a.add("a")
    a.add("b")
    a.add("c")

    a.forEach {
        println(it)
    }
    a.remove("b")

    a.forEach {
        println(it)
    }

    val listIterator = a.listIterator()
    if(listIterator.hasNext()){

        listIterator.next()

    }

    println("-------------------------------")

    // 线程安全的
    val vector = Vector<String>()
    vector.addElement("a")
    vector.addElement("b")
    vector.addElement("c")
    vector.forEach {
        println(it)
    }

    val hashtable = HashMap<String,String>()

    println("================================")

    val hashSet = HashSet<String>()
    hashSet.add("a")
    hashSet.add("")
    hashSet.add("")

    hashSet.forEach {
        println(it)
    }



}